package com.zjitc.Redis;

import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

/**
 * Create by IntelliJ IDEA
 *
 * @author: jsonor
 * @date-Time: 2018/4/10 15:53
 * @description:
 */
public class MyRedis {
  private JedisPool jedisPool;

  public MyRedis(JedisPool pool){
    this.jedisPool=pool;
  }

  public void hset(String key,String field ,String value){
    Jedis jedis=null;
    try {
      Jedis con=this.jedisPool.getResource();
      con.hset(key,field,value);
    }finally {
        this.jedisPool.returnResource(jedis);
    }
  }
}
